Show the code
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv(
"https://raw.githubusercontent.com/byuidatascience/data4names/master/data-raw/names_year/names_year.csv")
df = df[df["name"] == "Peter"]
plt.figure(figsize=(14,6))
plt.plot(df["year"], df["UT"], color="red", label="Utah")
plt.plot(df["year"], df["OR"], color="orange", label="Oregon")
for y in [1936, 1972, 2005]:
plt.axvline(y, color="black")
plt.text(y, max(df["UT"].max(), df["OR"].max())*0.95, y, ha="center")
plt.title("The history of Peter for Utah (red) and Oregon (orange)")
plt.xlabel("Year name given")
plt.ylabel("Count of Peter")
plt.grid(True)
plt.legend()
plt.show()